package com.qf.six.ssm.controller.client;

import com.qf.six.ssm.commen.request.ClientDetailRequestParam;
import com.qf.six.ssm.commen.request.ClientParam;
import com.qf.six.ssm.commen.vo.ResponseResult;
import com.qf.six.ssm.service.client.ClientServiice;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author ZL
 */
@RestController
@RequestMapping("/client")
public class ClientController {
    @Resource
    ClientServiice clientServiice;
    @GetMapping("/login")
    public ResponseResult<Object> login(ClientParam param){
        return clientServiice.select(param);
    }
    @GetMapping("/register")
    public ResponseResult<Object> register(ClientParam param){
        return clientServiice.insert(param);
    }
    @PostMapping("/update")
    public ResponseResult<Integer> update(ClientDetailRequestParam param){
        return ResponseResult.success(clientServiice.update(param));
    }
}
